<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="./../template/mainFrame/mainFrameBeforeLogin.xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
                xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:define name="content">
        <div class="pageContent allNews">
            <h1 class ="tableTitle"><h:outputLabel value="#{msgs.newsInfo}"/></h1>
            <h:form>
                <table class ="tableStyle allNewsTable" border="1">
                    <tr>
                        <th><h:outputLabel value="#{msgs.lastnewsInfo}"/></th></tr>
                    <c:forEach items="#{msgs.roleArray.split(',')}" var="roleName">
                        <c:forEach items="#{stuNewsBean.recentNews}" var="news">
                            <tr>
                                <td>
                                    <h:commandLink value="#{news.newstitle}"  action="#{stuNewsBean.directToNews()}">
                                        <f:param value="#{news.id}" name="newsId"/>
                                    </h:commandLink>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:forEach>
                </table>
                <table class ="tableStyle allNewsTable" border="1">
                    <c:forEach  items="#{msgs.roleArray.split(',')}" var="roleName">
                        <tr>
                            <th><h:outputLabel value="#{roleName}"/></th>
                        </tr>
                        <c:forEach items="#{newsBean.newsHashMap.get(roleName)}" var="news">
                            <tr>
                                <td>
                                    <h:commandLink value="#{news.newstitle}"  action="#{stuNewsBean.directToNews()}">
                                        <f:param value="#{news.id}" name="nId"/>
                                    </h:commandLink>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:forEach>
                </table>

            </h:form>
            <p style ="clear:both;"></p>
        </div>
    </ui:define>

</ui:composition>
